/*** 本文件由CSMIS2.0-ModelCreater(UTF-8)工具辅助生成，版本1.0 ***/

package com.ce.sys.org.logic.search;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.ce.framework.datamaintain.logic.ISQLMapper;
import com.ce.framework.datamaintain.logic.SQLSearchCondition;
import com.ce.framework.exception.AppException;
import com.ce.sys.org.dao.po.SysOrg;

/**
* 嫦娥软件有限公司 版权所有 2013
* 创建人：　andy
* 创建日期：2013-03-03
* 创建时间：16:13:55
* 功能描述：组织机构表 [SYS_T_ORG]条件过滤类
* ==============================================
* 修改历史
* 修改人		修改时间		修改原因
*
* ==============================================
*/
public class SysOrgSearchCondition  extends SQLSearchCondition
	implements ISQLMapper
{

	public String getSearchSql() throws AppException {
		
		StringBuffer sql = new StringBuffer("select * from SYS_T_ORG t where t.VC_DEL$FLAG = 0");
		/*=========自行修改该处代码================
		//实现排序的代码
		sql.append(" "+super.getOrderBy());
		======================================*/
		return sql.toString();
	}
	
	public Object fromSQLQuery(ResultSet rs, int num) {
		SysOrg view = new SysOrg();
		try {

			view.setVcId(rs.getString("VC_ID"));
			view.setVcNumber(rs.getString("VC_NUMBER"));
			view.setVcLevel(new Integer(rs.getInt("VC_LEVEL")));
			view.setNseq(new Integer(rs.getInt("N_SEQ")));
			view.setVcName(rs.getString("VC_NAME"));
			view.setVcType(rs.getString("VC_TYPE"));
			view.setVcManProType(new Integer(rs.getInt("VC_MAN$PRO$TYPE")));
			view.setVcDesc(rs.getString("VC_DESC"));
			view.setVcFlagLeaf(rs.getString("VC_FLAG$LEAF"));
			view.setVcParOrgid(rs.getString("VC_PAR$ORGID"));
			view.setVcParOrgTypeFlag(new Integer(rs.getInt("VC_PAR$ORG$TYPE$FLAG")));
			view.setVcOrgTypeFlag(new Integer(rs.getInt("VC_ORG$TYPE$FLAG")));
			view.setVcClass(rs.getString("VC_CLASS"));
			view.setVcOrgLevel(new Integer(rs.getInt("VC_ORG$LEVEL")));
			view.setVcDelFlag(new Integer(rs.getInt("VC_DEL$FLAG")));			

		} catch (SQLException e) {
			
			e.printStackTrace();
		}
		return view;
	}
	
	public ISQLMapper getSQLMapper() {
		
		return this;
	}

}

